package cn.ctodb.im.web.controller;

import cn.ctodb.im.dto.auth.LoginReqDTO;
import cn.ctodb.im.dto.auth.LoginRespDTO;
import cn.ctodb.im.rpc.AuthRpc;
import com.alibaba.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * All rights Reserved, Designed By www.ctodb.cn
 *
 * @version V1.0
 * @author: lichaohn@163.com
 * @date: 2018-11-15 13:55
 * @Copyright: 2018 www.ctodb.cn All rights reserved.
 */
@RestController
public class LoginController {
    private Logger logger = LoggerFactory.getLogger(LoginController.class);

    @Reference(check = false)
    private AuthRpc authRpc;

    @PostMapping("login")
    public LoginRespDTO login(@RequestBody LoginReqDTO loginReqDTO) {
        return authRpc.login(loginReqDTO);
    }

}
